#ifndef MBM_MW_ADAPTER_H
#define MBM_MW_ADAPTER_H

typedef enum
{
    MBM_Load_Success = 0,
    MBM_Load_ShellInitFailed = -1,
    MBM_Load_FileOpenFailed = -2,
    MBM_Load_FileReadFailed = -3,
    MBM_Load_MemNotEnough = -4,
    MBM_Load_Version_Error = -5

}e_mbm_load_error;


#ifdef __cplusplus
extern "C"
{
#endif

void mbm_mw_reg_key_handler(t_mbm_keyhandler hdr);
void mbm_mw_excute_key_handler(Int32 key_event, Int32 key_code);
void mbm_mw_reg_tp_handler(t_mbm_tphandler hdr);
void mbm_mw_excute_tp_handler(Int32 tp_event, Int32 x, Int32 y);
void mbm_mw_reg_state_handler(t_mbm_applet_state_handler hdr);
void mbm_mw_excute_state_handler(Int32 state);

/*
 * applet
 * return e_mbm_load_error
 */
Int32 mbm_run_applet(ImpCStr name, Int32 argc, Int8**argv);

void mbm_create_mw_window(void);
void mbm_applet_close_notify(void);
void mbm_close_applet(void);


/*
 * component
 */
void *mbm_load_component(ImpCStr name);
Int32 mbm_get_component_ref(void *h);
void* mbm_get_proc_address(void *handle, ImpCStr proc);
void mbm_free_component(void *handle);


/*
 * version
 */

Int8* mbm_get_mw_info(void);
Int8* mbm_get_mw_version(void);
Int8* mbm_get_mw_platform(void);
Int8* mbm_get_mw_hardware(void);
Int8* mbm_get_mw_software(void);


UInt32 mbm_set_owner(UInt32 owner);
void mbm_clear_owner(UInt32 owner);
UInt32 mbm_get_owner(void);

#ifdef __cplusplus
}
#endif

#endif//MBM_MW_ADAPTER_H
